package test1.girl;

public class girltest {
    public static void main(String[] args) {
        girl[]arr=new girl[4];
        test1.girl.girl gf1=new girl("小诗诗",18,"萌妹子","吃零食");
        test1.girl.girl gf2=new girl("小丹丹",19,"萌妹子","玩游戏");
        test1.girl.girl gf3=new girl("小慧慧",20,"萌妹子","看书，学习");
        test1.girl.girl gf4=new girl("小莉莉",21,"憨妹子","睡觉");
        arr[0]=gf1;
        arr[1]=gf2;
        arr[2]=gf3;
        arr[3]=gf4;
        int sum=0;
        for (int i = 0; i < arr.length; i++) {
            girl gf=arr[i];
            sum=sum+gf.getAge();
        }
        int avg=sum/arr.length;
        System.out.println("年龄的平均值为："+avg);
        int count=0;
        for (int i = 0; i < arr.length; i++) {
            girl gf=arr[i];
            if(gf.getAge()<avg){
                count++;
                System.out.println(gf.getName()+","+gf.getAge()+","+gf.getGender()+","+gf.getHobby());
            }
        }
        System.out.println(count+"个");
    }
}
